<template>
  <div>
    <button @click="get('这是文字',$event)">获取事件对象只能通过$event</button>
    <br /><br />
    {{num}}
    <input type="text" size="3" v-model="num">
  </div>
<!--  <div id="first" @click.stop="ab">-->
<!--    <div id="two" @click.stop="ac">-->
<!--      <div id="three" @click.stop="ad"></div>-->
<!--    </div>-->
<!--  </div>-->
<!--  <div id="first" @click.self="ab">
    <div id="two" @click.self="ac">
      <div id="three" @click.self="ad"></div>//只会在本身时才出发，也能解决冒泡问题
    </div>
  </div>-->
  <div id="first" @click.capture="ab">
    <div id="two" @click.capture="ac">
<!--      <div id="three" @click.capture="ad"></div>事件是从外向内执行-->
    </div>
  </div>
</template>

<script>
const date={
  num:1,
};
export default {
  name: "App",
  data(){
    return date;
  },
  methods:{
    get(e,event){
      console.log(e);
      console.log(event);
    },
    ab(){
      console.log("这是最外层");
    },
    ac(){
      console.log("这是第二层");
    },
    ad(){
      console.log("这是最里层");
    }
  }
}
</script>

<style scoped>
#first{
  width: 400px;
  height: 400px;
  background-color: chartreuse;
}
#two{
  width: 300px;
  height: 300px;
  background-color: aqua;
}
#three{
  width: 200px;
  height: 200px;
  background-color: burlywood;
}
</style>